<div class="wrapper-md-12" ng-controller="ServReqFlowController" ng-init="init()">
    <tabset class="tab-container">
        <button type="button" style="height:42px;margin-right:10px;" class="close" ng-click="cancel()"><span class="icon icon-close" aria-hidden="true"></span></button>
        <tab heading="{{'business.servreq.servReq' | translate}}">
            <div>
                <div class="form-group row">
                    <label class="col-sm-2 control-label " translate="business.servreq.id">ID of Service Request</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="S-{{patientPackage.servReq.servReq_Id}}" style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label" translate="common.updated">Status</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{ moment(patientPackage.servReq.updated).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <label class="col-sm-2 control-label " translate="common.name"></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._patCase._patient._user.realName}}" style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label" translate="user.mobilephone">Status</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.patient._user.mobile_Phone}}"
                               style="cursor:default" disabled>
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <label class="col-sm-2 control-label " translate="business.servreq.service">ID of Service Request</label>
                    <div class="col-sm-4" ng-cloak>
                        <input type="text" class="form-control" placeholder=""
                               value="{{ patientPackage.servReq._servType.service_Name }}" style="cursor:default" disabled>
                    </div>

                    <label class="col-sm-2 control-label" translate="business.servreq.status">Status</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{selectLang == 'English' ? patientPackage.servReq._status.enName : patientPackage.servReq._status.cnName}}"
                               style="cursor:default" disabled>
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row" >
                    <label class="col-sm-2 control-label " translate="business.servreq.Regional_name">Regional_name</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_Regional.realName}}" style="cursor:default" disabled>
                    </div>

                    <label class="col-sm-2 control-label " translate="business.servreq.medAdmin" ng-if="patientPackage.servReq._med_Admin != null">medAdmin</label>
                    <div class="col-sm-4" ng-if="patientPackage.servReq._med_Admin != null">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_Admin.realName}}" style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.select_Desc != '' && patientPackage.servReq.select_Desc != null">
                    <label class="col-sm-2 control-label" translate="business.servreq.selectDesc">medSpecial</label>

                    <div class="col-sm-10">
        <textarea class="form-control no-radius" required
                  ng-model="patientPackage.servReq.select_Desc"
                  style="cursor:default;resize:none;" disabled></textarea>
                    </div>
                    <div class="col-sm-2"></div>
                </div>


                <div class="form-group row" ng-if="patientPackage.servReq._med_Expert != null">
                    <label class="col-sm-2 control-label" translate="business.servreq.medExpert">medSpecial</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_Expert.realName}}" style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label" translate="business.servreq.diag_Date">medSpecial</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="" value="{{patientPackage.servReq.diag_Date == null ? '-' :moment(patientPackage.servReq.diag_Date).format('YYYY-MM-DD HH:mm')}}
        " style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq._diseaseType.desc != '' && patientPackage.servReq._diseaseType.desc != null">
                    <label class="col-sm-2 control-label "
                           translate="business.patcase.disease_type">disease_type</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{'business.patcase.disease_type_' + patientPackage.servReq._diseaseType.desc | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.diag_Desc != '' && patientPackage.servReq.diag_Desc != null">
                    <label class="col-sm-2 control-label " translate="business.servreq.diag_Desc">diag_Desc</label>

                    <div class="col-sm-10" style="margin-bottom: 10px">
                        <textarea class="form-control" style="height:80px;cursor:default;resize:none;" placeholder=""
                                  disabled ng-model="patientPackage.servReq.diag_Desc"></textarea>
                    </div>
                </div>


                <div class="form-group row" ng-if="patientPackage.servReq.opeSolu_Desc != '' && patientPackage.servReq.opeSolu_Desc != null">
                    <label class="col-sm-2 control-label "
                           translate="business.servreq.opeSolu_Desc">opeSolu_Desc</label>

                    <div class="col-sm-10">
                        <textarea type="text" class="form-control" placeholder=""
                                  ng-model="patientPackage.servReq.opeSolu_Desc"
                                  style="cursor:default; height:80px;resize:none;" disabled></textarea>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.accumulation.surgeon">surgeon</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._opeCenTime._surgeon.realName}}" style="cursor:default"
                               disabled>
                    </div>
                    <label class="col-sm-2 control-label "
                           translate="business.servreq.confirm_Operator">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{(patientPackage.servReq.confirm_Operator == 0 ? 'business.servreq.confirm0' : 'business.servreq.confirm1') | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>
                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && patientPackage.servReq.confirm_Operator_Date != null">
                    <label class="col-sm-2 control-label" translate="business.servreq.confirm_Operator_Date">Date for
                        Operator</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{moment(patientPackage.servReq.confirm_Operator_Date).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                </div>
                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label">
                        <span translate="common.operView"></span>
                    </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                               value="{{patientPackage.servReq.operator_Desc}}"
                               nstyle="cursor:default" disabled/>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.hosp.OpeCent">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{selectLang == 'English' ? patientPackage.servReq._opeCenTime._hosp.hosp_En_Name : patientPackage.servReq._opeCenTime._hosp.hosp_Cn_Name}}"
                               style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label " translate="user.hosplevel">hospital level</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{selectLang == 'English' ? patientPackage.servReq._opeCenTime._hosp._hospLevel.hospLevel_En_Name : patientPackage.servReq._opeCenTime._hosp._hospLevel.hospLevel_Cn_Name}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.accumulation.dateOpe"></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{moment(patientPackage.servReq._opeCenTime.date_Operation).format('YYYY-MM-DD')}}"
                               style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label " translate="business.accumulation.province"></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{selectLang == 'English' ? patientPackage.servReq._opeCenTime._hosp._province.loca_En_Name : patientPackage.servReq._opeCenTime._hosp._province.loca_Cn_Name}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.servreq.medCentDoc">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_CentDoc.realName}}" style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label " translate="business.servreq.confirm_CentDoc">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{(patientPackage.servReq.confirm_CentDoc == 0 ? 'business.servreq.confirm0' : 'business.servreq.confirm1') | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>
                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label">
                        <span translate="common.expView"></span>
                    </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                                value="{{patientPackage.servReq.centDoc_Desc}}" style="cursor:default" disabled/>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && patientPackage.servReq.confirm_CentDoc_Date != null">
                    <label class="col-sm-2 control-label" translate="business.servreq.confirm_CentDoc_Date">Date for
                        Operator</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{moment(patientPackage.servReq.confirm_CentDoc_Date).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.servreq.medBusiness">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_Business.realName}}" style="cursor:default"
                               disabled>
                    </div>
                    <label class="col-sm-2 control-label "
                           translate="business.servreq.confirm_Business">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{(patientPackage.servReq.confirm_Business == 0 ? 'business.servreq.confirm0' : 'business.servreq.confirm1') | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && patientPackage.servReq.confirm_Business_Date != '' && patientPackage.servReq.confirm_Business_Date != null">
                    <label class="col-sm-2 control-label" translate="business.servreq.confirm_Business_Date">Date for
                        Operator</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{moment(patientPackage.servReq.confirm_Business_Date).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label " translate="business.servreq.medFinance">username</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq._med_Finance.realName}}" style="cursor:default" disabled>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>

                <div class="form-group row" ng-if="patientPackage.servReq.need_Operation>0">
                    <label class="col-sm-2 control-label "
                           translate="business.servreq.paymentAmount">paymentAmount</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq.paid_Amount}}" style="cursor:default" disabled>
                    </div>
                    <label class="col-sm-2 control-label " translate="business.servreq.paid">Paid</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{(patientPackage.servReq.paid == 0 ? 'business.servreq.paid0' : 'business.servreq.paid1') | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && patientPackage.servReq.paid_Date != '' && (currentUser.isMedicalAdmin || currentUser.isSystemAdmin)">
                    <label class="col-sm-2 control-label" translate="business.servreq.paid_Date">Date for
                        Operator</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq.paid_Date == null ? '-' :moment(patientPackage.servReq.paid_Date).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && (currentUser.isMedicalAdmin || currentUser.isSystemAdmin)">
                    <label class="col-sm-2 control-label " translate="business.servreq.amount_Operation">amount_Operation</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq.amount_Operation}}" style="cursor:default" disabled>
                    </div>

                    <label class="col-sm-2 control-label " translate="business.servreq.paid">Paid</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{(patientPackage.servReq.paid_Operation == 0 ? 'business.servreq.paid0' : 'business.servreq.paid1') | translate}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="form-group row"
                     ng-if="patientPackage.servReq.need_Operation>0 && patientPackage.servReq.paid_Operation_Date != '' && (currentUser.isMedicalAdmin || currentUser.isSystemAdmin)">
                    <label class="col-sm-2 control-label" translate="business.servreq.paid_Date">Date for
                        Operator</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{patientPackage.servReq.paid_Operation_Date == null ? '-' :moment(patientPackage.servReq.paid_Operation_Date).format('YYYY-MM-DD HH:mm')}}"
                               style="cursor:default" disabled>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"
                     ng-if="patientPackage.servReq.need_Operation > 0"></div>
            </div>
        </tab>

        <tab heading="{{'business.servreq.flow' | translate}}">
            <ul class="timeline">
                <li class="tl-header">
                    <div class="btn btn-info btn-rounded"><span translate="business.servreq.start">Start</span></div>
                </li>
                <div ng-repeat="flow in patientPackage.servFlows">
                    <li class="tl-item tl-left">
                        <div class="tl-wrap b-primary">
                            <span class="tl-date" style="width:70px;">{{ moment(flow.updated).format("YYYY-MM-DD HH:mm") }}</span>

                            <div class="tl-content panel padder b-a block">
                                <span class="arrow left pull-up hidden-left"></span>
                                <span class="arrow right pull-up visible-left"></span>

                                <div class="panel-body pull-in b-light" style="padding-top: 0;">
                                    {{flow._user.realName}}
                                    <b ng-if="flow._user.isRegional == true">(<span
                                            translate="business.servreq.Regional_name"></span>)</b>
                                    <b ng-if="flow._user.isMedicalAdmin == true">(<span
                                            translate="business.servreq.medAdmin"></span>)</b>
                                    <b ng-if="flow._user.isSpecialist == true">(<span
                                            translate="business.servreq.medExpert"></span>)</b>
                                    <b ng-if="flow._user.isFinanceMgr == true">(<span
                                            translate="business.servreq.medFinance"></span>)</b><br>
                                    {{selectLang == 'English' ? flow._user._doctor._doctQuali.doctQuali_En_Name :
                                    flow._user._doctor._doctQuali.doctQuali_Cn_Name}}&nbsp;
                                    {{selectLang == 'English' ? flow._user._doctor._hosp.hosp_En_Name :
                                    flow._user._doctor._hosp.hosp_Cn_Name}}
                                </div>
                                <div class="panel-body pull-in b-t b-light newline"
                                     ng-if="flow.details != '' && flow.details != null" style="padding-bottom: 0;">
                                    {{flow.details}}
                                </div>
                            </div>
                        </div>
                    </li>

                    <li class="tl-header" ng-if="!flow._status.finished && flow.statusChanged && !$last">
                        <div class="btn btn-sm btn-default btn-rounded">{{selectLang == 'English' ? flow._status.enName
                            : flow._status.cnName}}
                        </div>
                    </li>
                    <li class="tl-header" ng-if="!flow._status.finished && flow.statusChanged && $last">
                        <div class="btn btn-sm btn-warning btn-rounded">{{selectLang == 'English' ? flow._status.enName
                            : flow._status.cnName}}
                        </div>
                    </li>
                    <li class="tl-header" ng-if="flow._status.finished && flow.statusChanged">
                        <div class="btn btn-info btn-rounded">{{selectLang == 'English' ? flow._status.enName :
                            flow._status.cnName}}
                        </div>
                    </li>

                    <li class="tl-item tl-left" ng-if="$last && flow._followUser != null && flow._followUser != ''">
                        <div class="tl-wrap b-primary">
                            <span class="tl-date"></span>

                            <div class="tl-content panel padder b-a block">
                                <span class="arrow left pull-up hidden-left"></span>
                                <span class="arrow right pull-up visible-left"></span>

                                <div class="panel-body pull-in b-light" style="padding-top: 0;color:red;">
                                    {{flow._followUser.realName}}
                                    <b ng-if="flow._followUser.isMedicalAdmin == true">(<span
                                            translate="business.servreq.medAdmin"></span>)</b>
                                    <b ng-if="flow._followUser.isSpecialist == true">(<span
                                            translate="business.servreq.medExpert"></span>)</b>
                                    <b ng-if="flow._followUser.isFinanceMgr == true">(<span
                                            translate="business.servreq.medFinance"></span>)</b><br>

                                    {{selectLang == 'English' ? flow._followUser._doctor._doctQuali.doctQuali_En_Name :
                                    flow._followUser._doctor._doctQuali.doctQuali_Cn_Name}}&nbsp;
                                    {{selectLang == 'English' ? flow._followUser._doctor._hosp.hosp_En_Name :
                                    flow._followUser._doctor._hosp.hosp_Cn_Name}}
                                </div>
                            </div>
                        </div>
                    </li>
                </div>
            </ul>
        </tab>

        <!--<tab heading="{{'aside.nav.process.evaluation' | translate}}"-->

        <tab heading="{{'aside.nav.process.evaluation' | translate}}"
             ng-if="patientPackage.servReq._customCareCase.isFinish">
            <div class="form-group">
                <label>{{ 'business.evaluation.pain_Level' | translate }}</label>
                <input type="number" class="form-control" ng-model="patientPackage.servReq._customCareCase.pain_Level"
                       style="cursor:default" disabled>
            </div>
            <div class="form-group">
                <label>{{ 'business.evaluation.compare_Previous' | translate }}</label>
                <input type="text" class="form-control"
                       value="{{'business.servreq.confirm_' + patientPackage.servReq._customCareCase.compare_Previous | translate}}"
                       style="cursor:default" disabled>
            </div>
            <div class="form-group">
                <label>{{ 'business.evaluation.service_Satis' | translate }}</label>
                <input type="text" class="form-control"
                       value="{{'business.servreq.satis_' + patientPackage.servReq._customCareCase.service_Satis | translate}}"
                       style="cursor:default" disabled>
            </div>
            <div class="form-group">
                <label>{{ 'business.evaluation.feedback' | translate }}</label>
                <input type="text" class="form-control" ng-model="patientPackage.servReq._customCareCase.feedback"
                       style="cursor:default" disabled>
            </div>
        </tab>
    </tabset>

</div>


<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">
        <span translate="common.close"></span>
    </button>
</div>


